package com.sf.dao;

import com.sf.model.RfDept;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface RfDeptMapper {
    int deleteByPrimaryKey(@Param("id")Integer id);

    int insert(@Param("dept")RfDept dept);

    int insertSelective(@Param("dept") RfDept dept);

    RfDept selectByPrimaryKey(@Param("id") Integer id);

    int updateByPrimaryKeySelective(@Param("dept") RfDept dept);

    int updateByPrimaryKey(@Param("dept") RfDept dept);

    //获取所有部门
    List<RfDept> getAllDept();

    //获取当前层级子部门
    List<RfDept> getChildDeptListByLevel(@Param("level") String level);

    //批量更新部门层级
    void batchUpdateLevel(@Param("deptList") List<RfDept> deptList);

    //查询是否有相同部门
    int countByNameAndParentId(@Param("parentId") Integer prentId, @Param("name") String deptName, @Param("id") Integer deptId);
}